package com.ds.infrastructure.hyperspace.console.model.response.environment;

import com.ds.infrastructure.hyperspace.console.entity.table.TbEnvironment;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author: yaozhendong
 * @create: 2019-09-18 12:46
 **/
@Data
@NoArgsConstructor
public class GetEnvironmentVO {
    private Long id;

    private Long parentId;

    private String environmentName;

    private String packageName;

    private Integer usageState;

    private String description;


    private Date gmtModified;

    private Date gmtCreate;

    public static GetEnvironmentVO toVO(TbEnvironment entity) {
        GetEnvironmentVO getEnvironmentVO = new GetEnvironmentVO();
        getEnvironmentVO.setId(entity.getId());
        getEnvironmentVO.setParentId(entity.getParentId());
        getEnvironmentVO.setEnvironmentName(entity.getEnvironmentName());
        getEnvironmentVO.setPackageName(entity.getPackageName());
        getEnvironmentVO.setUsageState(entity.getUsageState());
        getEnvironmentVO.setDescription(entity.getDescription());
        getEnvironmentVO.setGmtModified(entity.getGmtModified());
        getEnvironmentVO.setGmtCreate(entity.getGmtCreate());
        return getEnvironmentVO;
    }
}
